<%-- 
    Document   : visualizzaAste
    Created on : 4-gen-2013, 16.40.17
    Author     : Luciano
--%>


<%@page import="java.util.List"%>
<%@page import="it.unitn.science.matr155863_148346_145963.bccastestore.items.Asta"%>
<%@page import="it.unitn.science.matr155863_148346_145963.bccastestore.items.User"%>
<%@page import="it.unitn.science.matr155863_148346_145963.bccastestore.items.Product"%>
<%@page import="it.unitn.science.matr155863_148346_145963.bccastestore.DBManager"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>

<%!
    private DBManager db;
    
    @Override
    public void init() throws UnavailableException{
            db=(DBManager)super.getServletContext().getAttribute("db_manager");
            
    }
%>        

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>aste correnti</title>
    </head>
    <body>
        <%
         
         List<Asta> aste = db.getAsteCorrenti();
                  
        %>
        <div class="content">
            <h2>ASTE ATTIVE:</h2>
            <br/>
            <%
               for(Asta a:aste){
                  request.setAttribute("asta", a);
                  %>  
                  <jsp:include page="../user/astaDetails.jsp" flush="true" />
                  <form name="annullaAsta" method="post" action="<%=response.encodeURL(request.getContextPath())%>/contents/admin/annullaAsta" >
                      <input type="hidden" name="id" value="<%=a.getId() %>" />
                      <h3>Annulla Asta:</h3>
                      <input type="submit" name="annullaAsta" value="annullaAsta"/>
                  </form>
                      <hr>  
                      <br/><br/>
                  <%
              }
            %>                      
        </div>
    </body>
</html>

